load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_zig//zig:defs.bzl", "zig_library", "zig_test")

cc_library(
    name = "c",
    hdrs = ["mlir.h"],
    visibility = ["//mlir:__subpackages__"],
    deps = [
        "@llvm-project//mlir:CAPIArith",
        "@llvm-project//mlir:CAPIIR",
        "@llvm-project//mlir:CAPIMath",
        "@llvm-project//mlir:CAPISCF",
        "@llvm-project//mlir:CAPITransforms",
    ],
)

zig_library(
    name = "mlir",
    main = "mlir.zig",
    visibility = ["//visibility:public"],
    deps = [
        ":c",
        "//stdx",
    ],
)

zig_test(
    name = "test",
    deps = [":mlir"],
)
